New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@feathersjs/commons

Package Overview
Dependencies
Maintainers
3
Versions
107
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@feathersjs/commons

Shared Feathers utility functions

  • 5.0.32
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
3
Created

What is @feathersjs/commons?

@feathersjs/commons is a utility library for the Feathers framework, providing a set of common utilities and helper functions that can be used across different parts of a Feathers application. These utilities help with various tasks such as object manipulation, promise handling, and other common programming patterns.

What are @feathersjs/commons's main functionalities?

Object manipulation

The @feathersjs/commons package provides utilities for object manipulation, such as picking specific properties from an object.

const { _ } = require('@feathersjs/commons');

const obj = { a: 1, b: 2, c: 3 };
const picked = _.pick(obj, 'a', 'c');
console.log(picked); // { a: 1, c: 3 }

Promise handling

The package includes utilities for handling promises, such as converting callback-based functions to promise-based ones using `promisify`.

const { promisify } = require('@feathersjs/commons');

const callbackFunction = (data, callback) => {
  setTimeout(() => callback(null, data), 1000);
};

const promiseFunction = promisify(callbackFunction);

promiseFunction('Hello, world!').then(result => console.log(result)); // 'Hello, world!'

Deep object merging

The package provides utilities for deep merging of objects, which is useful for combining configuration objects or state.

const { merge } = require('@feathersjs/commons');

const obj1 = { a: 1, b: { c: 2 } };
const obj2 = { b: { d: 3 }, e: 4 };
const merged = merge({}, obj1, obj2);
console.log(merged); // { a: 1, b: { c: 2, d: 3 }, e: 4 }

Other packages similar to @feathersjs/commons

Keywords

FAQs

Package last updated on 01 Feb 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc